#ifndef LAURIN_80211_FRAME_H_
#define LAURIN_80211_FRAME_H_

#include "laurin-ieee80211.h"
#include "laurin-radio-info.h"
#include "laurin-80211-station.h"
#include "linux_ieee80211_radiotap.h"
#include <glibmm/ustring.h>

class Laurin80211Frame
{

	public:

		Laurin80211Frame();
		Laurin80211Frame(const Laurin80211Frame& frame);
		virtual ~Laurin80211Frame();


		bool setFrame(const u_char* frame, int len);
		bool parse80211FrameType();
		bool parse80211Header();
		bool parseRadiotapHeader();



		struct laurin_packet_radio_info getRadioInformations() const;
		u_int8_t* getDestinationAddress() const;
		u_int8_t* getSourceAddress() const;
		u_int8_t* getBSSID() const;
		short getFrameType() const;
		short getFrameSubType() const;


		// these methods have sense only if frame is a beacon one
		Glib::ustring getSSID() const;
		bool isNetworkEncrypted() const;
		bool isIBBSFrame() const;
		int getInterval() const;


	private:

		struct laurin_packet_radio_info _radio;
		struct ieee80211_radiotap_header* _radiotap;
		const u_char* _frame;

		short _type;
		short _subType;
		int _len;
		bool _allocated;

		u_int8_t* _source;
		u_int8_t* _destination;
		u_int8_t* _bssid;

		bool _ibss;
		Glib::ustring _ssid;
		int _interval;
		bool _encrypted;




};

#endif
